<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .a {
            width: 300px;
            height: 300px;
            background-color: #f00;

            position: relative;
            overflow: hidden;
        }

        .a p {
            width: 300px;
            height: 50px;
            background-color: #ff0;

            position: absolute;
            top: 0;

            /* transform: translateY(-50px);
            transition: 1s; */

            top: -50px;
            transition: 1s;
        }

        .a:hover p {
            /* transform: translate(0); */

            top: 0;
        }
    </style>
</head>

<body>

    <div class="a">
        <p></p>
    </div>

</body>

</html>